package b4.controller
{
	import b4.view.SmithyMediator;
	import b4.view.component.smithy.Smithy;
	
	import org.puremvc.as3.interfaces.ICommand;
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand;
	import b4.view.ApplicationMediator;
	
	public class ShowSmithyCommand extends SimpleCommand implements ICommand
	{
		override public function execute(notification:INotification):void
		{
			var applicationMediator:ApplicationMediator = facade.retrieveMediator(ApplicationMediator.NAME) as ApplicationMediator;
			if (facade.hasMediator(SmithyMediator.NAME))
			{
				facade.removeMediator(SmithyMediator.NAME);
			}
			else
			{
				var smithy:Smithy = new Smithy();
				 facade.registerMediator(new SmithyMediator(smithy));
			}
			
		}
	} 
}
